﻿using System;
using System.ComponentModel;

namespace NullableNumericUpDownExample.Classes
{
    public class ValuesIncubator : INotifyPropertyChanged
    {

        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }

        private int _valueInt;
        public int ValueInt
        {
            get { return _valueInt; }
            set
            {
                if (value != _valueInt)
                {
                    _valueInt = value;
                    NotifyPropertyChanged("ValueInt");
                }
            }
        }

        private int? _valueNullableInt;
        public int? ValueNullableInt
        {
            get { return _valueNullableInt; }
            set
            {
                if (value != _valueNullableInt)
                {
                    _valueNullableInt = value;
                    NotifyPropertyChanged("ValueNullableInt");
                }
            }
        }

        private double _valueDouble;
        public double ValueDouble
        {
            get { return _valueDouble; }
            set
            {
                if (value != _valueDouble)
                {
                    _valueDouble = value;
                    NotifyPropertyChanged("ValueDouble");
                }
            }
        }

        private double? _valueNullableDouble;
        public double? ValueNullableDouble
        {
            get { return _valueNullableDouble; }
            set
            {
                if (value != _valueNullableDouble)
                {
                    _valueNullableDouble = value;
                    NotifyPropertyChanged("ValueNullableDouble");
                }
            }
        }
    }
}
